function navigation(obj, type){
	var objArray = Array();
	var objArrayHtml = Array();
	//gnb 메뉴
	$("#gnb_wrap > ul > li > span > a").each(function(i){
		objArray[i] = $(this);
	});

	$("#gnb_wrap > ul > li > span >a").each(function(i){
		$(this).bind("mouseover mouseout focus blur",function(event){
			if (event.type=='mouseover' || event.type=='focus')
			{
				for (var j=0; j<objArray.length ; j++)
				{
					if (i==j)
					{
						$(objArray[j]).parent().parent().find("ul").show();
						$(objArray[i]).addClass("mouseover");

						$(objArray[j]).parent().parent().find("*").each(function(i){
							objArrayHtml[i] = $(this).html();
						});

						$(objArray[j]).parent().parent().find("ul").bind("mouseout mouseover focus blur", function(event){
							if (event.type=="mouseout" || event.type=="blur")
							{
								if (inArray(objArrayHtml, $(event.relatedTarget).html())==false || $(event.relatedTarget).html()=='')
								{
									$(this).hide();
									$(objArray[i]).removeClass("mouseover");
								}
							}
							else if (event.type=='mouseover' || event.type=="focus")
							{
								$(objArray[i]).addClass("mouseover");
							}
						});
					}
					else
					{
						$(objArray[j]).parent().parent().find("ul").hide();
						$(objArray[j]).removeClass("mouseover");
					}
				}
			}
			if (event.type=="mouseout")
			{
				$(this).parent().parent().find("*").each(function(i){
					objArrayHtml[i] = $(this).html();
				});

				if (inArray(objArrayHtml, $(event.relatedTarget).html())==false)
				{
					//$(this).parent().parent().find("ul").hide();
					//$(objArray[i]).removeClass("mouseover");
				}
			}
		});
	});
}

function inArray(arr, val) {
	for (var i = 0, len = arr.length; i < len; i++) {
		if(arr[i] === val) return true;
	}
	return false;
}

function sleep(sec) { 
	var now = new Date();
	var exitTime = now.getTime() + (sec);
	while (true) {
		now = new Date();
		if (now.getTime() > exitTime) return;
	}
}